<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02_BOM操作</title>
</head>
<body>
<button onclick="getMoney()">我要钱</button>
<hr>
<script>
    function getMoney(){
        var imgE = document.createElement('img');//创建img元素<img>
        imgE.src = 'img/money.jpg';
        imgE.width = 200;
        var bodyE = document.querySelector('body');//获取body元素
        bodyE.append(imgE);//将img元素添加到body元素中
    }
</script>
</body>
</html>